import request from '@/utils/request'

// 查询平台角色列表
export function listPlatformRole(query) {
  return request({
    url: '/system/platformRole/list',
    method: 'get',
    params: query
  })
}

// 变更角色状态
export function changeStatus(query) {
  return request({
    url: '/system/platformRole/changeStatus',
    method: 'get',
    params: query
  })
}

// 获取系统全部菜单
export function getSystemAllMenu(query) {
  return request({
    url: '/system/platformRole/getSystemAllMenu',
    method: 'get',
    params: query
  })
}

// 获取小程序全部菜单
export function getAppletAllMenu(query) {
  return request({
    url: '/system/platformRole/getAppletAllMenu',
    method: 'get',
    params: query
  })
}

// 查询平台角色详细
export function getPlatformRole(id) {
  return request({
    url: '/system/platformRole/' + id,
    method: 'get'
  })
}

// 根据角色ID查询关联用户
export function getAccountByRole(data) {
  return request({
    url: '/system/platformRole/getAccountByRole',
    method: 'post',
    data: data
  })
}

// 移除角色关联用户
export function deleteAccount(data) {
  return request({
    url: '/system/platformRole/deleteAccount',
    method: 'post',
    data: data
  })
}

// 新增平台角色
export function addPlatformRole(data) {
  return request({
    url: '/system/platformRole',
    method: 'post',
    data: data
  })
}

// 修改平台角色
export function updatePlatformRole(data) {
  return request({
    url: '/system/platformRole',
    method: 'put',
    data: data
  })
}

// 删除平台角色
export function delPlatformRole(id) {
  return request({
    url: '/system/platformRole/' + id,
    method: 'delete'
  })
}
